UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aomybJDh8O9dUrpHVmlfYMJH+PJ9sEfUZb1KiXuJgX0='
WHERE
key_id = 'b3d6824c04eeff6f142a14cd37bce2c1f0d48d7f1994bd5a2ec3262dce901aff'
AND (
token = 'aomybJDh8O9dUrpHVmlfYMJH+PJ9sEfUZb1KiXuJgX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)