UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rur8UwNziHAZo4J9qk8FDLAVjDt9IiMR4kW62VbdbBk='
WHERE
key_id = '0b4c67aa06b395c2795477a64723a4124b7944d7749bb0c8ea99aa7966096291'
AND (
token = 'rur8UwNziHAZo4J9qk8FDLAVjDt9IiMR4kW62VbdbBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)