UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DXD7ToJ9JrPB8SLrZB39wJ87pU97bP0Ucj5dEntqxJI=' 
WHERE 
  key_id = '802096b66036070c6b9ad23ca4ef6cf9a75c5f3767cddf4200ee5ce264a0ec72' 
  AND (
    token = 'DXD7ToJ9JrPB8SLrZB39wJ87pU97bP0Ucj5dEntqxJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027