UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4h2ZeLum0ruUVAdNQnVeYndj3wpI6GWCtUX1zApY2I8='
WHERE
key_id = '3dc26cb1971783ca003b9d23a8f98ea41f4843432381b5b117490a85dba51363'
AND (
token = '4h2ZeLum0ruUVAdNQnVeYndj3wpI6GWCtUX1zApY2I8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)