UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xs0himPMhTc9BizYxNvW+vfr1DmYEvhZrOK98tKmh1k='
WHERE
key_id = '5f1a6b362947d6e99e0d8123e543a7b9e4109483de1ca9d622807737c9e0d564'
AND (
token = 'Xs0himPMhTc9BizYxNvW+vfr1DmYEvhZrOK98tKmh1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)