UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J5l1S6PgyAbd3ityz6Oo6hx9UulijK6JxS5/AF/02CQ=' 
WHERE 
  key_id = '777af957b314417fa7648bba8c20ee3f17b78e5bacca179c9c6d383a43b36a7f' 
  AND (
    token = 'J5l1S6PgyAbd3ityz6Oo6hx9UulijK6JxS5/AF/02CQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060