UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HC+lmmaX2CWMfENhS/0ukpTASCGLc2hYALTlAtq1rB8='
WHERE
key_id = 'b0faecec602714e5605f2b30f4e6d6276e881f4dffc3ceda6d77b2cd7efe00a4'
AND (
token = 'HC+lmmaX2CWMfENhS/0ukpTASCGLc2hYALTlAtq1rB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)