UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P1BGhjfrhIjptlHm1Tv/lE/jWVB5aA8cmAeHS/nB1No='
WHERE
key_id = '42c4ff8b5c21e9c9f5526cc0be88442c6ee9eb2f2097218acedbc82e1e7b31c6'
AND (
token = 'P1BGhjfrhIjptlHm1Tv/lE/jWVB5aA8cmAeHS/nB1No='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)