UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fciaMKfjtNwYEOAiCaTAUv6tMmpyTsLRuRpGQN1YFUs='
WHERE
key_id = '6cb6beede86298cc3755e65bbf0b07fb13df1b3526f27fd6f29f1eba3a3a2ebb'
AND (
token = 'fciaMKfjtNwYEOAiCaTAUv6tMmpyTsLRuRpGQN1YFUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)