UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5oHrwsICECOf+LROS3IXBXDnC5a6QDByCt/XfUgKWkw=' 
WHERE 
  key_id = '261cd814c4d324ce9141cb60bf39baed304b5991c98337ce91f36b2937f7026b' 
  AND (
    token = '5oHrwsICECOf+LROS3IXBXDnC5a6QDByCt/XfUgKWkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035