UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vizlvLHSohp8Djc/YVbiUw8eBbPG4XHYSXsR4Gy4Wn4=' 
WHERE 
  key_id = '9a7b9f64119c53c1d5ae22a47df0957bd1707a62dffeb7c5320fc758aede2f99' 
  AND (
    token = 'vizlvLHSohp8Djc/YVbiUw8eBbPG4XHYSXsR4Gy4Wn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034