UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kntq4bfesnZGMopPO418Xyb7l/E8dIw0W2CFKSS7EMw='
WHERE
key_id = '5937dafc5a4943c3a939e9a5ddb15e66cc32eff79774c97554ab325de5fbec3c'
AND (
token = 'Kntq4bfesnZGMopPO418Xyb7l/E8dIw0W2CFKSS7EMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)