UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Eq3Pe2X/uRBRFd9Orv16FQqiDQCPav3aCbh7xgoNdE='
WHERE
key_id = 'e87dc7cd3b9c35892e0826cb45cadc21debb05f3491bc108ee2ae07f11666b38'
AND (
token = '1Eq3Pe2X/uRBRFd9Orv16FQqiDQCPav3aCbh7xgoNdE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)