UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b29SXL9c3kmOVFo3rwUaQsHPfmmfIEW+tFDB6EHtEdM=' 
WHERE 
  key_id = 'ecdc95c1b9bfd391c92dc94d2aac85399d746d1c9e1465f577ea7617df91e2e7' 
  AND (
    token = 'b29SXL9c3kmOVFo3rwUaQsHPfmmfIEW+tFDB6EHtEdM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019