UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kXj93R5LDkTfTVq4oo0LrluiLGYZTlswzsdfwGfwa4o='
WHERE
key_id = '52af399a75d725560ed00dc467de77bb63efd3e713717b85ee888a871b04be64'
AND (
token = 'kXj93R5LDkTfTVq4oo0LrluiLGYZTlswzsdfwGfwa4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)