UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XdmcKcAJ5WZlnM7l/Q5YcpBKNF+bWeEgKelQE61T/CQ='
WHERE
key_id = '224ae1b45dfeba71dd998e4a83f6e3ffda43d90abd172f0135d5f2a9fc33a21c'
AND (
token = 'XdmcKcAJ5WZlnM7l/Q5YcpBKNF+bWeEgKelQE61T/CQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)