UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'skSL5WH0CMpqUAfewJJ/F/UkpLHdnP7ySBFElqzqFrE='
WHERE
key_id = '6ec1e60cba69b2c23504951d732528153cff8dfb8d32fcd4726c3be749ddd3ac'
AND (
token = 'skSL5WH0CMpqUAfewJJ/F/UkpLHdnP7ySBFElqzqFrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)