UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w3owKXeVEnRTZYvNpBoHJp/sfIORdHZqwM+/jF4qqOY='
WHERE
key_id = '055ff6677d8bc6e5aae626b17c8f802f4da62bd12aff4d40b4748a12fd06186a'
AND (
token = 'w3owKXeVEnRTZYvNpBoHJp/sfIORdHZqwM+/jF4qqOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)