UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mNjlG8HfmQaz2BFz6w+cNVvRxH++6TqA/LKVgsqdKwY=' 
WHERE 
  key_id = '55f2547dd556b486ce8ba15b5f206d071b81f3aac188f5b41acd519fc6d49cc6' 
  AND (
    token = 'mNjlG8HfmQaz2BFz6w+cNVvRxH++6TqA/LKVgsqdKwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044