UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2oHXvt3A3toFsKsADqGOWhSPFftueMEql1gTZa/B8/k='
WHERE
key_id = 'fd004ac7c821ed82b0e1c65b61f65902b9fa9425102335695a5372a2c7285498'
AND (
token = '2oHXvt3A3toFsKsADqGOWhSPFftueMEql1gTZa/B8/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)