UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7nJpafIM4TJ68UG01vNMhlBPfHOpYB0202MMUlLyyiI='
WHERE
key_id = 'e036548ffc0c6f6b32b4273225990281c22f5766322ec637098d9097e9f848e8'
AND (
token = '7nJpafIM4TJ68UG01vNMhlBPfHOpYB0202MMUlLyyiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)