UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yt5HAPXEO+dWixC0F5KrEyT1z3cykgCOVA6cfVJSGmo='
WHERE
key_id = 'c722a0b2064849f81c61eacd0358da7729087288cd330c22429bd286121dbe0d'
AND (
token = 'yt5HAPXEO+dWixC0F5KrEyT1z3cykgCOVA6cfVJSGmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)