UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i1zAkyKwfudfjlXmwiuHu3+Cj5bDGwVPHgCR7yEzchs=' 
WHERE 
  key_id = '657a7d64a006a0cd02a6a67bea22a889fcb4762dbef85589a4dafdf74eaeb862' 
  AND (
    token = 'i1zAkyKwfudfjlXmwiuHu3+Cj5bDGwVPHgCR7yEzchs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053