UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '//fJKcyvlDv+0zc+xUIaBsTyi2gLWX/hlN5QpjCfu/s='
WHERE
key_id = 'd1ac73809951be59855215d91e566055ac68a600df506ac23473e076d377e28c'
AND (
token = '//fJKcyvlDv+0zc+xUIaBsTyi2gLWX/hlN5QpjCfu/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)