UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QqrUxOw6BhPivpgBMiOYHjW2gtZLFDIRtV1U/hWtXws='
WHERE
key_id = '6bd9924763d2d252bd344ce9d7e8b88640f680826019c79957d8c0b7ec19fb59'
AND (
token = 'QqrUxOw6BhPivpgBMiOYHjW2gtZLFDIRtV1U/hWtXws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)