UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ZMz4cx1/lr9+xZeH3MONDuqNZR9R1MH48EGVoDuxOg=' 
WHERE 
  key_id = '7585af46bbcb03e67f1484582d38003cf9c1039b936c3869d5a530c27344a234' 
  AND (
    token = '1ZMz4cx1/lr9+xZeH3MONDuqNZR9R1MH48EGVoDuxOg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043