UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+9Og66rL+PIy64YHOSBB6AGdf+5MKPAvrEpMHO20NoQ='
WHERE
key_id = 'b5f201132b37070b504dbb8498d4bf4b86a0f9c5c0bb1bc392657f7545055f04'
AND (
token = '+9Og66rL+PIy64YHOSBB6AGdf+5MKPAvrEpMHO20NoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)