UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c/k+qKP2+NhGmvzds72Qj5kpd+sx4w5HpAX5JsGBV80='
WHERE
key_id = '7bbf19a2139c7dbc4b33702b830840e9e868814aa64012480ef2925ebc8b70cf'
AND (
token = 'c/k+qKP2+NhGmvzds72Qj5kpd+sx4w5HpAX5JsGBV80='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)