UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1f2KGTPhLf9/2k2FXbS0p7Zj4x3tPcJHsSZHmM8jzWQ=' 
WHERE 
  key_id = 'e0a5d0e42dc3fd4d0216ddd407681407781a61245b6f2a61fed3a5b8986fd9f9' 
  AND (
    token = '1f2KGTPhLf9/2k2FXbS0p7Zj4x3tPcJHsSZHmM8jzWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029