UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+yFcOrCoSmUHxb8bVCJ4QNnFkeraJCWKLLo/0i0eLr8='
WHERE
key_id = '2eb29a8396eda056aa2a4c49a8c118c61ce9f1a19a97c4796afedeb39814f5a2'
AND (
token = '+yFcOrCoSmUHxb8bVCJ4QNnFkeraJCWKLLo/0i0eLr8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)