UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yqn5/l0d98HpOJOYJobpNhF6biw9yF/y7Kou4zzpTwM='
WHERE
key_id = 'b5c18be8aa08b0adfc07284f12487694a205077d53a297e33c36be87ef159893'
AND (
token = 'yqn5/l0d98HpOJOYJobpNhF6biw9yF/y7Kou4zzpTwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)