UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MCKmRQ14n0i7hzrXZq+EbvkOslfvX7Sj5o3atnPBRzY=' 
WHERE 
  key_id = 'f39a6951dfb4fd235a87ce4f4bec489266a429387b964800a2ae102ad9e376b0' 
  AND (
    token = 'MCKmRQ14n0i7hzrXZq+EbvkOslfvX7Sj5o3atnPBRzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020