UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FaH4lxceqdbwRDOSxYgzvwXtk8pMo5/atUloL8ODLAo=' 
WHERE 
  key_id = '351fa17fc86e68458832b28e6237cdfb170d69a161c86b47ca48c1b86e6f1b2d' 
  AND (
    token = 'FaH4lxceqdbwRDOSxYgzvwXtk8pMo5/atUloL8ODLAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059