UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jXIQ+0fePRkpgx/VGx8SI+94fPCHxB/N5982FUPhrjM=' 
WHERE 
  key_id = '185e359bebf9c135af84f3bb8891fe299a8ba9092de22afb8ea0ad355280b4cc' 
  AND (
    token = 'jXIQ+0fePRkpgx/VGx8SI+94fPCHxB/N5982FUPhrjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048