UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sh11Z/xOpQJ0iY1Q7LZ+Y4Dd1ICscFqYwfQokhdgw5Y=' 
WHERE 
  key_id = '5f5c0138f32b8ad4bcc0f9d8c000d38c9a5e0edf4b4db64bf2f8615415c08f88' 
  AND (
    token = 'sh11Z/xOpQJ0iY1Q7LZ+Y4Dd1ICscFqYwfQokhdgw5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021