UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SUSVnWHpsgloZl9iSuyoV6UcFrV2xbeHNTLuhZWYefk='
WHERE
key_id = 'a934c4e78dcad94aa0f4cf81c5f4e1e5c5444c03378e6858688444463feb2ed8'
AND (
token = 'SUSVnWHpsgloZl9iSuyoV6UcFrV2xbeHNTLuhZWYefk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)