UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OocbX0VyW5xnAhQYlEdpRPFU1GTKIKLv/nh+IRjahI4=' 
WHERE 
  key_id = '9b3375762ac654dd14d3d30337e14a2ada29dc305542dde5ed90a46c5156c3f2' 
  AND (
    token = 'OocbX0VyW5xnAhQYlEdpRPFU1GTKIKLv/nh+IRjahI4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016