UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KBpnYufb67WcM6/yKVdssJmHcj6detT8buMPo0HMw9g=' 
WHERE 
  key_id = '00883cb001b94d8e6ee7355c56c6364d0da1887e80e4e8e829766dcd21ef23f2' 
  AND (
    token = 'KBpnYufb67WcM6/yKVdssJmHcj6detT8buMPo0HMw9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058