UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R8Z8/sn4r6uPuSY2VNOWPFEgoKyLGd/45QIhjI4FQ2o=' 
WHERE 
  key_id = 'ef967930e2a504fdf67d11a3d1b782bcce88e8173725fb2c8484ce1ce4a7d4fe' 
  AND (
    token = 'R8Z8/sn4r6uPuSY2VNOWPFEgoKyLGd/45QIhjI4FQ2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019