UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SQQYxl8n/R9r7zuSzEVvn53iUVeMwcxJCgVFEzz0J/4='
WHERE
key_id = '5b9a841666a609085056c14cd4836ff9707e272c6fa57d4a2de05025e2f4d520'
AND (
token = 'SQQYxl8n/R9r7zuSzEVvn53iUVeMwcxJCgVFEzz0J/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)