UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FmDdqq5nbMqtbhoSJgjusvTGBJdJwlF5Gkvg11pAQs0='
WHERE
key_id = '73f83a3ab56eeeb7891b5cae5fa3c5a313c50b97f8d89bca06d0a2587cc83ba3'
AND (
token = 'FmDdqq5nbMqtbhoSJgjusvTGBJdJwlF5Gkvg11pAQs0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)