UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1uaKsPKgveiypOrhUZuA0Lrl/zA3uqn0Z+YTQPUEgdQ='
WHERE
key_id = '7897759406e83a9a140acbd96e3e714f0abe73d132a79b1db40aca276412a20c'
AND (
token = '1uaKsPKgveiypOrhUZuA0Lrl/zA3uqn0Z+YTQPUEgdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)