UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lR44VH7joPrSgWtP6NjTU9JpIl23NvdlxR310/Gph6k=' 
WHERE 
  key_id = 'f7264ab6d3727f1e9b438c070f1155ef1e906aa7122e2b21cf80fad403bc8472' 
  AND (
    token = 'lR44VH7joPrSgWtP6NjTU9JpIl23NvdlxR310/Gph6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055