UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JZzKITOTRBRquQxvI+XJEgwGZasEEaWlbw5FlrYX3bA=' 
WHERE 
  key_id = 'ff2248b85de67986f5a8658dafd1d62e5aea05e667f64d5aad4ba064efed4de0' 
  AND (
    token = 'JZzKITOTRBRquQxvI+XJEgwGZasEEaWlbw5FlrYX3bA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019